<?php

use App\Http\Middleware\Authenticate;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/


Route::get('/', function () {
    return 999999;
});
Route::get('/test', function () {

    $service=new \App\Http\Service\WordService();
    $res= $service->sendMessage('woddp');
//   $res= $service->add_contact_way();
var_dump($res);
});
Route::prefix('v1')->group(function (){
    Route::any('/onLogin', \App\Http\Controllers\MiniAppController::class.'@auth');
    Route::get('/isLogin', \App\Http\Controllers\MiniAppController::class.'@isLogin')->middleware( Authenticate::class);
    Route::get('/cos/token', \App\Http\Controllers\MiniAppController::class.'@cos')->middleware( Authenticate::class);
    Route::post('/user/update', \App\Http\Controllers\MiniAppController::class.'@update')->middleware( Authenticate::class);
    Route::get('/pets/config', \App\Http\Controllers\PetsController::class.'@getConfig')->middleware( Authenticate::class);
    Route::post('/pets/add', \App\Http\Controllers\PetsController::class.'@add')->middleware( Authenticate::class);
    Route::get('/pets/lists', \App\Http\Controllers\PetsController::class.'@lists')->middleware( Authenticate::class);
    Route::get('/pets/delete/{id}', \App\Http\Controllers\PetsController::class.'@delete')->middleware( Authenticate::class);
    Route::post('/business/add', \App\Http\Controllers\BusinessController::class.'@add')->middleware( Authenticate::class);
    Route::get('/business/lists', \App\Http\Controllers\BusinessController::class.'@lists')->middleware( Authenticate::class);
    Route::get('/business/get/{id}', \App\Http\Controllers\BusinessController::class.'@get');
    Route::get('/business/show/{id}', \App\Http\Controllers\BusinessController::class.'@show');
    Route::get('/article/get/{id}', \App\Http\Controllers\ArticleController::class.'@get');
    Route::any('/miniapp/pay/callback',\App\Http\Controllers\MiniAppPayController::class.'@callback');
    Route::post('/miniapp/pay',\App\Http\Controllers\MiniAppPayController::class.'@pay')->middleware( Authenticate::class);
});

Route::prefix('work')->group(function (){
    Route::get('/auth/redirect', \App\Work\AuthController::class.'@redirect');
    Route::get('/job/perfect', \App\Work\JobController::class.'@perfect');
});
